/*
 * @ProjectName: 编程学习
 * @Copyright:   2021 HangZhou Yiyuery Dev, Ltd. All Right Reserved.
 * @address:     微信搜索公众号「架构探险之道」获取更多资源。
 * @date:        2021/1/13 9:15 下午
 * @blog:         https://yiyuery.blog.csdn.net/
 * @description: 本内容仅限于编程技术学习使用，转发请注明出处.
 */
package pub.dsb.example.nio;

import java.nio.Buffer;
import java.nio.ByteBuffer;

/**
 * <p>
 *
 * </p>
 *
 * @author Yi
 * @date 2021/1/13 9:15 下午
 * @sine 1.0
 */
public class NioTest {

    public static void main(String[] args) {
        ByteBuffer byteBuffer = ByteBuffer.allocate(32);
        byteBuffer.putDouble(3.14159);
        byteBuffer.putChar('Y');
        byteBuffer.putInt(2021);
        byteBuffer.flip();
        System.out.println(byteBuffer.getDouble());
        System.out.println(byteBuffer.getChar());
        System.out.println(byteBuffer.getInt());
    }
}
